package com.cssy.authority.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.authority.dao.ScUserOrganizationDAO;
import com.cssy.authority.entity.ScUserOrganizationDO;
import com.cssy.authority.service.IScMenuRoleOrganizationService;
import com.cssy.authority.service.IScUserRolewhPlaceService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.plat.util.IDCodeTypeUtil;


@Service("scUsermenuPlaceService")
public class ScMenuRoleOrganizationServiceImpl implements IScMenuRoleOrganizationService{

	
	@Resource(name="scUserOrganizationDAO")	
	private ScUserOrganizationDAO scUserOrganizationDAO;
	

	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		SearchResult rs=new SearchResult(scs);
		List<ScUserOrganizationDO>  list=scUserOrganizationDAO.find(scs);
		rs.setRecordCount(scUserOrganizationDAO.count(scs));
		rs.setResults(list);
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		scUserOrganizationDAO.deleteScUserOrganizationDOByPrimaryKey(Long.parseLong(id));
		return null;
	}

	@Override
	public Integer update(ScUserOrganizationDO t, User user) throws SyBaseException {

		return scUserOrganizationDAO.updateScUserOrganizationDO(t);
	}

	@Override
	public ScUserOrganizationDO save(ScUserOrganizationDO t, User user)
			throws SyBaseException {
		scUserOrganizationDAO.insertScUserOrganizationDO(t);
		return t;
	}

	@Override
	public ScUserOrganizationDO findListById(String id) throws SyBaseException {
		return scUserOrganizationDAO.findScUserOrganizationDOByPrimaryKey(Long.parseLong(id));
	}

	@Override
	public Integer deleteuserid(String id) throws SyBaseException {
		scUserOrganizationDAO.deleteScUserOrganization(Long.parseLong(id));
		return null;
	}

	@Override
	public List<ScUserOrganizationDO> findByUserId(String id)
			throws SyBaseException {
		return scUserOrganizationDAO.findScUserOrganizationDOByUserId(Long.parseLong(id));
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}

}
